Repository navigation
media: qcom: camss: add Qualcomm SC8180X (Titan 175) camera subsystem & MIPI CSI-2 PHY support - #206
Open
robertijtsma wants to merge 5 commits into
Open
robertijtsma wants to merge 5 commits into
robertijtsma wants to merge 5 commits into
Conversation
Add the standalone Qualcomm MIPI CSI-2 D-PHY generic PHY driver based on Linaro's upstream RFC driver (Bryan O'Donoghue <bod@kernel.org>), with SC8180X / SM8150 bring-up fixes verified on Microsoft Surface Pro X SQ2: - Match qcom,sc8180x-csi2-phy alongside qcom,sm8150-csi2-phy and qcom,x1e80100-csi2-phy. - Detach the auto-attached single power domain before calling devm_pm_domain_attach_list() to avoid -EEXIST on single-domain SoCs. - Fall back to direct core clock rate setting when an OPP table ceiling is unavailable, and allow unpopulated CSIPHY ports to probe passively. - Keep the PHY powered across stream restarts and reconfigure/reset lanes cleanly without disturbing TITAN_TOP_GDSC. Tested on Microsoft Surface Pro X SQ2 (SC8180X) with OV5693 (CSIPHY0), OV13858 (CSIPHY2), and OV7251 IR (CSIPHY3). Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
Allow CAMSS platforms whose DT port endpoints connect to standalone generic PHY nodes (such as phy-qcom-mipi-csi2) to configure and power CSIPHY through the Linux generic PHY API while preserving the existing built-in CSIPHY implementation unchanged for all legacy platforms. Based on Linaro's upstream RFC CAMSS external-PHY architecture, adapted cleanly onto v7.3 without modifying any existing SoC definitions. Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
… gen2 RDI
Fix several hardware bring-up and stability bugs in the Titan 17x VFE
and CSID gen2 paths:
- VFE-17x / VFE-Lite:
* Check STATUS_1_RDI_SOF(i) against status1 instead of status0.
* Guard VFE_BUS_WM_DEBUG_STATUS_CFG (0x226c) behind !vfe_is_lite(),
restrict VFE-Lite global reset bits to valid blocks, and use the
4-client WM_ADDR_NO_SYNC_LITE_VAL mask on VFE-Lite.
* Manage the 2-deep VFE_BUS_WM_IMAGE_ADDR hardware FIFO cleanly via
vfe_buf_done(), with a coherent dummy DMA buffer fallback on total
underrun and single WM_CLIENT_BUF_DONE IRQ subscription (avoiding
double completions and 1-frame shifts).
* Keep VFE_CORE_CFG = 0 for local SOF latching, implement vfe_halt()
IRQ masking/clearing, request VFE IRQs with IRQF_NO_AUTOEN, and
match numbered vfe_liteN clocks in vfe_match_clock_names().
* Invoke vb2_buffer_done() outside output_lock in vfe_flush_buffers()
and destroy VFE mutexes after unregistering subdev/video entities.
- CSID gen2:
* Support unpacked 16-bit plain LSB RAW10 formats
(MEDIA_BUS_FMT_Y10_2X8_PADHI_LE and
MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE).
* Clear BIT(RDI_CFG0_ENABLE) when stopping a stream, add
csid_reset_retain_sw_reg() before resuming RDI, and invoke
configure_stream(csid, 0) on stream stop.
* Release parent_dev_ops on csid_set_power() failure paths.
Tested on Microsoft Surface Pro X SQ2 (SC8180X, Titan 175) with live
OV5693 (5 MP), OV13858 (13 MP), and OV7251 (IR) streams.
Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
Add Qualcomm SC8180X / SM8150 (Titan 175) CAMSS resource tables and compatible strings (qcom,sc8180x-camss, qcom,sm8150-camss) covering CSIPHY0-3 (via external phy-qcom-mipi-csi2), CSID0-1 + CSID_LITE0-1, VFE0-1 + VFE_LITE0-1, and CAMNOC interconnects: - Explicit 400 MHz vfe*_cphy_rx rates, camnoc_dcd_xo, and vfe0/1_dsp clocks on SC8180X/SM8150. - Keep CAMSS/VFE/CSID bus clocks, IRQs, and interconnects active while loaded on CAMSS_8150 and perform frame-boundary stop + warm vfe_reset() on stream reuse instead of post-stream GLOBAL_RESET_CMD_BUS, preventing the SC8180X NoC bus deadlock without altering behavior on any other SoC. Tested on Microsoft Surface Pro X SQ2 (SC8180X, Linux 7.3.1-1-surface). Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
…, and RDI format clamping Add three portable improvements to Qualcomm CAMSS: 1. Optional DT privacy LED GPIOs (privacy-led-front-gpios and privacy-led-rear-gpios) refcounted per CSIPHY stream start/stop so hardware camera privacy indicators stay strictly synchronized with active streams. 2. Pipeline start rollback in video_start_streaming() (stopping already started subdevices if a downstream s_stream(1) fails) and complete sink-to-source teardown in video_stop_streaming() without aborting on non-fatal warnings, plus refreshing DMA addresses in video_buf_prepare(). 3. Clamp non-line-based RDI video nodes to the active upstream subdev format in __video_try_fmt(), allowing generic V4L2 clients (such as OpenCV/Howdy on OV7251 Y10) to negotiate VIDIOC_S_FMT cleanly. Tested on Microsoft Surface Pro X SQ2 (SC8180X, Linux 7.3.1-1-surface). Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
This was referenced Nov 22, 2026
robertijtsma
added a commit
to robertijtsma/surface-pro-x-sq2-linux
that referenced
this pull request
Nov 22, 2026
… in patch 0004 Regenerate patches/0004-media-qcom-camss-sc8180x-titan175-full.patch from the verified upstream-ready linux-surface/kernel#206 series: - Include the missing drivers/media/platform/qcom/camss/camss-csiphy.h header hunk so the patch compiles standalone against Linux v7.3. - Remove unintended v7.3 regressions to qcm2290, qcs8300, and sa8775p and scope all SC8180X NoC keep-alive logic strictly to CAMSS_8150. Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bring up the Qualcomm SC8180X / Titan 175 camera subsystem (
qcom-camss+phy-qcom-mipi-csi2) for Microsoft Surface Pro X (SQ1 / SQ2) onspx/v7.3, split into five atomic, reviewable commits without disturbing any existing Qualcomm SoC definitions:phy: qualcomm: add MIPI CSI-2 D-PHY driver for SM8150/SC8180Xphy-qcom-mipi-csi2generic PHY driver based on Linaro's upstream RFC driver (Bryan O'Donoghue), matchingqcom,sc8180x-csi2-phy/qcom,sm8150-csi2-phy/qcom,x1e80100-csi2-phy, with SC8180X fixes for single-domain genpd detachment (-EEXIST), core clock fallback, unpopulated port probing, and warm restart safety.media: qcom: camss: support external generic PHY subdevices for CSIPHYlegacy_phy = false) alongsidemsm_csiphy_subdev_init_legacy()so all existing built-in CSIPHY SoCs remain completely unchanged.media: qcom: camss: fix Titan 17x VFE/VFE-Lite IRQ, WM FIFO, and CSID gen2 RDISTATUS_1_RDI_SOF(i)being checked againststatus0instead ofstatus1.!vfe_is_lite()guard onVFE_BUS_WM_DEBUG_STATUS_CFG, valid Lite reset bitmask, 4-clientWM_ADDR_NO_SYNC_LITE_VAL, numberedvfe_liteNclock matching).VFE_BUS_WM_IMAGE_ADDRFIFO viavfe_buf_done()with a coherent dummy DMA fallback on total underrun and singleWM_CLIENT_BUF_DONEIRQ subscription (eliminating double completions and 1-frame shift bugs).VFE_CORE_CFG = 0for local SOF latching, implementsvfe_halt(), requests VFE IRQs withIRQF_NO_AUTOEN, movesvb2_buffer_done()outsideoutput_lockinvfe_flush_buffers(), and destroys VFE mutexes after entity teardown.Y10_2X8_PADHI_LE,SBGGR10_2X8_PADHI_LE),csid_reset_retain_sw_reg(), properRDI_CFG0_ENABLEclearing on stream stop, andparent_dev_opserror unwind.media: qcom: camss: add Qualcomm SC8180X / SM8150 (Titan 175) supportCAMSS_8150(qcom,sc8180x-camss,qcom,sm8150-camss) resource tables (CSIPHY0–3, CSID0–1 + CSID_LITE0–1, VFE0–1 + VFE_LITE0–1, CAMNOC interconnects, 400 MHzvfe*_cphy_rx,camnoc_dcd_xo,vfe0/1_dsp) andCAMSS_8150-scoped NoC-safe power/clock retention and warmvfe_reset().media: qcom: camss: add optional privacy LED GPIOs, pipeline rollback, and RDI format clampingprivacy-led-front-gpios/privacy-led-rear-gpiossynchronized with CSIPHY streaming.s_stream(1)rollback invideo_start_streaming()+ full sink-to-source teardown invideo_stop_streaming().__video_try_fmt()so generic V4L2 clients (e.g., OpenCV / Howdy on OV7251 Y10) negotiateVIDIOC_S_FMTcleanly.Verification
phy-qcom-mipi-csi2.kocompiled cleanly withW=1against Linux7.3.1-1-surface(0 errors, 0 warnings).qcom-camss.kocompiled cleanly at every intermediate commit and final HEAD against Linux7.3.1-1-surface(0 errors, 0 warnings)../scripts/checkpatch.pl --no-treerun on all 5 commits: 0 errors, 0 code style warnings (only the expectedMAINTAINERSadvisory for the new PHY driver files).SC8180X) streaming all 3 onboard cameras:OV5693, CSIPHY0 → CSID0 → VFE0 RDI0) via libcamera + PipeWireOV13858, CSIPHY2 → CSID1 → VFE1 RDI0) via libcamera + PipeWireOV7251, CSIPHY3 → CSID_LITE1 → VFE_LITE1 RDI0) via OpenCV / Howdy